var httpsUrl = getApp().globalData.httpsUrl;
var globalData = getApp().globalData;
var commonUtil = require("../../../utils/commonUtil.js")
Page({

  data: {
    imgUrl: globalData.imgUrl,
    list:[],
  },
  onLoad: function () {
    var that = this;
    var params = new Object();
    params.cardid = wx.getStorageSync("cardId");
    let openId = wx.getStorageSync("openidKey");
    console.log("param:" + JSON.stringify(params));
    wx.request({
      header: { "openId": openId, "content-Type": "application/x-www-form-urlencoded" },
      url: httpsUrl + "/card/getCardBusiness",
      dataType: "json",
      method: "GET",
      data: params,
      success: function (res) {
        res = res.data;
        console.log("res：" + JSON.stringify(res));
        if (res.result == 0) {
          that.setData({ list: res.data })
        }
      }
    })
  },
  shopInfo: function (e) {
    let id = e.currentTarget.id;
    wx.setStorageSync("businessCode", id)
    wx.navigateTo({
      url: '../../shop/shopInfo/shopInfo',
    })
  },
})